package com.wn.sk.order.client;

import com.wn.common.api.Result;
import com.wn.common.api.order.dto.OrderDto;
import com.wn.common.api.order.vo.OrderVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author yellow Docter
 * @date 2022 -09-08
 * @desc
 */
@FeignClient("order-service")
public interface OrderFeignClient {

    //这里的方法要求
    @PostMapping("/order")
    public Result<String> createOrder(@RequestBody OrderDto dto);

    //通过订单 编号 查询 订单信息
    @GetMapping("/order/{orderSn}")
    Result<OrderVo> getOrderBySn(@PathVariable("orderSn") String orderSn);

    /**
     * 付款后的一个更新操作
     * @param orderSn
     * @return
     */
    @PutMapping("/auth/order/{orderSn}")
    Result update(@PathVariable("orderSn") String orderSn);

}
